import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import router from './router'
import App from './App.vue'

console.log('🚀 main.js 开始执行')

const app = createApp(App)

app.use(ElementPlus)
app.use(router)

// 确保路由就绪后再挂载应用
router.isReady().then(() => {
  console.log('✅ 路由准备就绪，开始挂载应用')
  app.mount('#app')
}).catch((error) => {
  console.error('❌ 路由准备失败:', error)
})